import ujson
import sys

json_path = sys.argv[1]

with open(json_path, 'r') as f:
    content = f.read()
    # print(content)
    content = ujson.loads(content)

typeset = set()

def get_all_type(node):
    if isinstance(node, dict):
        for (key,value) in node.items():
            if key == 'type':
                print(value)
                typeset.add(value)
                if 'name' in node:
                    print(node['name'])
                else:
                    print('no node name')
            if isinstance(value, dict):
                get_all_type(value)
            elif isinstance(value, list):
                for item in value:
                    get_all_type(item)
                
# --------------------------------------------

from pycparser import parse_file

def file_to_json(filename):
    ast = parse_file(filename)
    
